// const arr =[1,2,3]
// const iterator = arr[Symbol.iterator]()
// console.log(iterator.next());


function createIterator(arr){
    let index =0
    return {
        next: function(){
            return {value: arr[index++], done:index>arr.length}
        }
    }
}
const myIterator = createIterator([1,2,3])
